package com.son.hotel.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class Knife4jConfig {

    @Bean
    public OpenAPI openAPI() {
//        // 注册自定义的 Result 泛型模型
//        Schema<?> schema = new Schema<Object>()
//                .addProperty("code", new StringSchema().example("200"))
//                .addProperty("msg", new StringSchema().example("成功"))
//                .addProperty("data", new Schema<>().description("实际数据"));
        Contact contact = new Contact();
        contact.name("两仪式quq").email("1831134087@qq.com");
        return new OpenAPI()
                .info(new Info().title("API 文档").description("这是一份测试文档").contact(contact));
//                .schema("Result", schema); // 关键：声明 Result 结构
    }
}

